<?php
namespace app\admin\controller;

use think\Config;
use think\Controller;
use think\Session;

class Base extends Controller
{
    protected $session_id;
    protected $session_name;
    protected $mod;

	public function _initialize(){
        if (!action('login/checkLogin')){
            $this->redirect('Login/index');
        }
        $this->session_id = Session::get(Config::get('session_prefix').'id');
        $this->session_name = Session::get(Config::get('session_prefix').'name');
	}

    /**
     * 记录删除
     */
    public function del() {
        $id = $this->request->param('id');
        if (is_array($id)) {
            $id = ArrayToString($id);
        }
        $where['id'] = array('in', $id);
        $data['is_work'] = 0;
        $this->mod->save($data, $where);
        $this->success('删除成功！');
    }
}
